A file filter function filters the files that are displayed to the user in a dialog box. You specify this function in the fileFilter parameter of the SFGetFilePreview , StandardGetFilePreview , and CustomGetFilePreview routines. If this parameter is not nil , SFGetFilePreview calls the function for each file to determine whether to display the file to the user. The SFGetFilePreview function supplies you with the information it receives from the File Manager's GetFileInfo routine (see Inside Macintosh: Files for more information).
A file filter function whose address is passed to SFGetFilePreview , StandardGetFilePreview , or CustomGetFilePreview should have the following form.
pascal Boolean MyFileFilter (ParmBlkPtr parmBlock);
When SFGetFilePreview , StandardGetFilePreview , or CustomGetFilePreview is displaying the contents of a volume or folder, it checks the file type of each file and filters out files whose types do not match your application's specifications. If your application also supplies a file filter function, the Standard File Package calls that function each time it identifies a file of an acceptable type.
When your file filter function is called, it is passed, in the paramBlock parameter, a pointer to a catalog information parameter block. See the chapter "File Manager" in Inside Macintosh: Files for a description of the fields of this parameter block.
Your function evaluates the catalog information parameter block and returns a Boolean value that determines whether the file is filtered (that is, a value of true suppresses display of the filename, and a value of false allows the display). If you do not supply a file filter function, the Standard File Package displays all files of the specified types.